package com.gali.juc;

import java.util.concurrent.TimeUnit;

/**
 * @Auther: gali
 * @Date: 2022-08-18 15:59
 * @Description:
 */
public class Start {
    public static void main(String[] args) {
        Thread t1=new Thread(()->{
            System.out.println(Thread.currentThread().getName()+"开始运行，"+
                    (Thread.currentThread().isDaemon()?"守护线程":"用户线程"));
        },"t1");
                t1.setDaemon(true);
                t1.start();
        //暂停几秒钟
        try {
            TimeUnit.SECONDS.sleep(3);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(Thread.currentThread().getName()+" 主线程");

    }
}
